import React, {Component} from 'react';
import {StyleSheet,Text,Button,View} from 'react-native';

type Props = {};
export default class MainScreen extends Component<Props> {

    constructor(props) {
        super(props);
    }

    componentWillMount() {
        let initparams = this.props.navigation.state.params;
        console.log('传来的参数:\n');
        console.log(initparams);

        this.props.navigation.navigate('Mine',{});
    }

    render(){
        //获取nav
        const { navigate } = this.props.navigation;
        return (
            <View style={styles.container}>
                <Text>this is main screen</Text>
                <Button
                    title="Go to Jane's profile"
                    onPress={() =>
                        navigate('Profile', { name: 'Jane' })
                    }
                />
            </View>
        )
    }

}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: '#F5FCFF',
    }
});
